//
//  RDHomeHistoryTableViewCell.m
//  ReverseDiabetes
//
//  Created by 王佩璇 on 2024/8/25.
//

#import "RDHomeHistoryTableViewCell.h"
@interface RDHomeHistoryTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *bloodSugarValueLab;
@property (weak, nonatomic) IBOutlet UILabel *createTimeLab;
@property (weak, nonatomic) IBOutlet UILabel *bloodSugarTagLab;
@property (weak, nonatomic) IBOutlet UILabel *bloodSugarStateLab;
@property (weak, nonatomic) IBOutlet UILabel *recordingTimeLab;

@end
@implementation RDHomeHistoryTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(RDBloodSugar *)model{
    _model = model;
    
    self.bloodSugarValueLab.text = model.blood_sugar_value;
    self.createTimeLab.text = model.create_time;
    
    RDBloodSugarTag *bloodSugarTag = [RDBloodSugarTool getTagById:model.blood_sugar_tag];
    self.bloodSugarTagLab.text = bloodSugarTag.tag_name;
    self.bloodSugarStateLab.text = [RDBloodSugarTool getStateNameBytype:[RDBloodSugarTool getStateByBloodSugar:model]];
    
    self.recordingTimeLab.text = model.recording_time;
}

- (IBAction)delClick:(id)sender {
    if ([self.delegate respondsToSelector:@selector(didDelClick:)]) {
        [self.delegate didDelClick:self.row];
    }
}


@end
